/**
 * Created with IntelliJ IDEA
 * Description
 * User：chenshu
 * Date：2023-10-12
 * Time：22:27
 */
public class TestDemo {
    public static int maxNum(int a, int b) {
        return Math.max(a, b);
    }
    public static double maxNum(double a, double b, double c) {
        double d = Math.max(a, b);
        return Math.max(c, d);
    }
    public static int fibNum(int n) {
        if (n == 1 || n == 2) {
            return 1;
        }
        return fibNum(n-1) + fibNum(n-2);
    }
    public static int addDigit(int n) {
        if (n == 0)
            return 0;
        return n % 10 + addDigit(n/10);
    }
    public static void printDigit(int n) {
        if (n == 0)
            return;
        printDigit(n/10);
        System.out.print(n%10+" ");
    }
    public static int sum(int n) {
        if(n == 1){
            return 1;
        }
        return n + sum(n-1);
    }
    public static int factorial(int n) {
        if (n == 1)
            return 1;
        return n * factorial(n-1);
    }
    public static void main(String[] args) {
//        System.out.println(maxNum(88, 99));
//        System.out.println(maxNum(9.5, 2.5, 3.5));
//        System.out.println(fibNum(6));
//        System.out.println(addDigit(1234));
//        printDigit(1234);
//        System.out.println(sum(10));
        System.out.println(factorial(5));
    }
}
